package cn.chinaiptv.bean;

import java.util.ArrayList;

/**
 * 分页显示的javabean
 * 
 * @author ddk
 *
 */
public class PageBean {
	private int curPage = 1; // 当前是第几页
	private int maxPage; // 一共有多少页
	private int maxRowCount; // 一共有多少行
	public int rowsPerPage = 10; // 每页多少行
	public ArrayList<RecordBean> beans;

	public int getCurPage() {
		return curPage;
	}

	public void setCurPage(int curPage) {
		this.curPage = curPage;
	}

	public int getMaxPage() {
		return maxPage;
	}

	public void setMaxPage(int maxPage) {
		this.maxPage = maxPage;
	}

	public int getMaxRowCount() {
		return maxRowCount;
	}

	public void setMaxRowCount(int maxRowCount) {
		this.maxRowCount = maxRowCount;
	}

	public int getRowsPerPage() {
		return rowsPerPage;
	}

	public void setRowsPerPage(int rowsPerPage) {
		this.rowsPerPage = rowsPerPage;
	}

	// 得到要显示于本页的数据
	public PageBean getResult(String page) throws Exception {
		try {
			PageBean pageBean = new PageBean();
			ArrayList<RecordBean> list = new ArrayList<RecordBean>();
			int pageNum = Integer.parseInt(page);
			// if(beans.)
			pageBean.setCurPage(pageNum);
			pageBean.beans = list;
			return pageBean;
		} catch (Exception e) {
			e.printStackTrace();
			throw e;

		}
	}

}
